﻿using Ninject.Modules;
using Soundteller.Audio.Model;
using Soundteller.Audio.Model.Interfaces;
using Soundteller.Audio.Repositories;
using Soundteller.Audio.Repositories.Interfaces;
using Soundteller.Audio.Services;
using Soundteller.Audio.Services.Interfaces;

namespace Soundteller.Audio
{
    public class AudioModule : NinjectModule
    {
        public NinjectModule Get()
        {
            return this;
        }

        public override void Load()
        {
            Bind<IMemoryContext>().To<MemoryContext>().InSingletonScope();

            Bind<IBeatRepository>().To<BeatRepository>().InSingletonScope();
            Bind<ISongRepository>().To<SongRepository>().InSingletonScope();
            Bind<ISoundBufferRepository>().To<SoundBufferRepository>().InSingletonScope();
            Bind<IStorageRepository>().To<StorageRepository>().InSingletonScope();

            Bind<IBeatCalculator>().To<BeatCalculator>().InSingletonScope();
            Bind<IMetronome>().To<Metronome>().InSingletonScope();
            Bind<ISongLoader>().To<SongLoader>().InSingletonScope();
            Bind<ISoundPlayer>().To<SoundPlayer>().InSingletonScope();
        }
    }
}